<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Floral Shop, Check Out, Web Store</title>
<meta name="keywords"
	content="free template, floral shop, ecommerce, online shopping, store" />
<meta name="description"
	content="Floral Shop, Check Out, free template for ecommerce websites." />
<link href="__CSS__/templatemo_style.css" rel="stylesheet"
	type="text/css" />
<link rel="stylesheet" href="__CSS__/orman.css" type="text/css"
	media="screen" />
<style type="text/css">
body{
	width: 380px;
	height: 300px;
}
</style>
<script type="text/javascript" src="__JS__/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
	/*获取相册分类数据并插入*/
	$.post("{:U('Album/getAllNav')}",
	   function(data){
		data = eval('('+data+')');
    	$.each(data,function(i,nav){
    		var option = $("<option>").val(nav.id).text(nav.name);
			$('#album_nav').append(option);
		});
	},'json');
	
	/*表单提交*/
	$('#content').submit(function(){
		$.post("{:U('Album/add')}",$("form").serialize(),
				   function(res){
				    if(res){
				    	alert("添加成功");
				    	window.top.location.reload(); 
				    }else{
				    	alert("添加失败，请重试");
				    }
				});
		return false;
	});
});
</script>
</head>
<body>
	<div id="content" style="margin-left:10px;border:0" >
		<h2>上传图片</h2>
		<form action="{:U('photo/upload')}" method="post" enctype="multipart/form-data">
		<div class="content_half left form_field">
			相册名称 ：
			<input name="name" type="text" maxlength="40" value=""/>
			<div class="cleaner h10"></div>
			相册介绍：
			<textarea name="introduce"  style="resize:none; opacity: 0.5;  " rows='3' cols='33'> </textarea>
				<div class="cleaner h20"></div>
			所属分类：
			<select name="album_nav_id" id="album_nav">
				<option value="">---请选择---</option>
			</select>
				<div class="cleaner h20"></div>
				<input type="submit" value='添加' style="width: 50px;margin-left: 100px;"/>
		</div>
		</form>
		<div class="cleaner h40"></div>
	</div>
</body>
</html>